<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCompaniesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('companies', function (Blueprint $table) {
            $table->increments('id')->comment('主键');
            $table->integer('user_id')->nullable(false)->comment('创建人ID');
            $table->string('interview_assistant',32)->comment('云信账户');
            $table->string('interview_token',128)->comment('云信账户token');
            $table->string('name',255)->nullable()->default($value='')->comment('公司名称');
            $table->string('role_flag',24)->nullable()->unique()->comment('权限标识');
            $table->tinyInteger('status')->default('0')->comment('0正常，1删除');
            $table->integer('created_at')->comment('创建时间');
            $table->integer('updated_at')->comment('最后更新时间');
//            $table->timestamps();
        });
        DB::statement("ALTER TABLE `companies` comment '公司表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('companies');
    }
}
